﻿using System;
using System.Collections.Generic;
using Character;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using Utility;

// Token: 0x020001EE RID: 494
public class EditScene : Scene
{
	// Token: 0x17000170 RID: 368
	// (get) Token: 0x06000D2F RID: 3375 RVA: 0x0004F994 File Offset: 0x0004DB94
	public Transform ShowTransform
	{
		get
		{
			return this._showTransform;
		}
	}

	// Token: 0x17000171 RID: 369
	// (get) Token: 0x06000D30 RID: 3376 RVA: 0x0004F99C File Offset: 0x0004DB9C
	public IEnumerable<float> ShowVerticalPosition
	{
		get
		{
			return this._showVerticalPosition;
		}
	}

	// Token: 0x06000D31 RID: 3377 RVA: 0x0004F9A4 File Offset: 0x0004DBA4
	private void Start()
	{
		base.InScene(true);
		base.GC.audioCtrl.BGM_LoadAndPlay(this.bgm, false, false);
		this.camera = UnityEngine.Object.FindObjectOfType<IllusionCamera>();
		this.poseTypeDropdown.onValueChanged.AddListener(new UnityAction<int>(this.OnChangePoseType));
		this.poseNoDropdown.onValueChanged.AddListener(new UnityAction<int>(this.OnChangePoseNo));
		this.eyeExpressionDropdown.onValueChanged.AddListener(new UnityAction<int>(this.OnChangeEyeExpression));
		this.mouthExpressionDropdown.onValueChanged.AddListener(new UnityAction<int>(this.OnChangeMouthExpression));
		string empty = string.Empty;
		EditScene.AnalyzeMessage(this.sceneInMsg, out empty, out this.nextScene);
		HEROINE heroine = HEROINE.NUM;
		MALE_ID male_ID = MALE_ID.NUM;
		if (empty.Length > 0)
		{
			for (HEROINE heroine2 = HEROINE.RITSUKO; heroine2 < HEROINE.NUM; heroine2++)
			{
				if (empty == Female.HeroineName(heroine2))
				{
					heroine = heroine2;
					break;
				}
			}
			for (MALE_ID male_ID2 = MALE_ID.HERO; male_ID2 < MALE_ID.NUM; male_ID2++)
			{
				if (empty == Male.MaleName(male_ID2))
				{
					male_ID = male_ID2;
					break;
				}
			}
		}
		if (heroine != HEROINE.NUM)
		{
			for (int i = 0; i < this.toCustomMs.Length; i++)
			{
				this.toCustomMs[i].gameObject.SetActive(true);
			}
			for (int j = 0; j < this.toCustomFs.Length; j++)
			{
				this.toCustomFs[j].gameObject.SetActive(j != (int)heroine);
			}
			this.CreateFemale(heroine);
		}
		else if (male_ID != MALE_ID.NUM)
		{
			for (int k = 0; k < this.toCustomMs.Length; k++)
			{
				this.toCustomMs[k].gameObject.SetActive(k != (int)male_ID);
			}
			for (int l = 0; l < this.toCustomFs.Length; l++)
			{
				this.toCustomFs[l].gameObject.SetActive(true);
			}
			this.CreateMale(male_ID);
		}
		for (int m = 0; m < this.toCustomMs.Length; m++)
		{
			int no = m;
			this.toCustomMs[m].onClick.AddListener(delegate()
			{
				this.Button_Custom_M(no);
			});
		}
		for (int n = 0; n < this.toCustomFs.Length; n++)
		{
			int no = n;
			this.toCustomFs[n].onClick.AddListener(delegate()
			{
				this.Button_Custom_F(no);
			});
		}
		if (this.nextScene == "GameStart")
		{
			this.toReturn.GetComponentInChildren<Text>().text = "ゲーム開始";
		}
		else
		{
			this.toReturn.GetComponentInChildren<Text>().text = "選択画面";
		}
		this.config = UnityEngine.Object.Instantiate<Config>(this.configOriginal);
		this.config.gameObject.SetActive(false);
		this.pauseMenue = UnityEngine.Object.Instantiate<PauseMenue>(this.pauseMenueOriginal);
		this.pauseMenue.Setup(true, true, new Action(this.OpenConfig), new Action(this.Button_Title), new Action(this.OnExit));
		this.light.SetupLight();
		this.poseCameraFocus.isOn = GlobalData.poseChangeCameraFocus;
	}

	// Token: 0x06000D32 RID: 3378 RVA: 0x0004FD30 File Offset: 0x0004DF30
	public static string CreateMessage(string charaName, string next)
	{
		string text = string.Empty;
		if (charaName != null)
		{
			text = text + "chara:" + charaName;
		}
		if (next != null)
		{
			if (text.Length > 0)
			{
				text += ",";
			}
			text = text + "next:" + next;
		}
		return text;
	}

	// Token: 0x06000D33 RID: 3379 RVA: 0x0004FD84 File Offset: 0x0004DF84
	private static void AnalyzeMessage(string msg, out string charaName, out string next)
	{
		string[] array = msg.Split(new char[]
		{
			','
		}, StringSplitOptions.RemoveEmptyEntries);
		charaName = string.Empty;
		next = string.Empty;
		for (int i = 0; i < array.Length; i++)
		{
			string[] array2 = array[i].Split(new char[]
			{
				':'
			}, StringSplitOptions.RemoveEmptyEntries);
			if (array2.Length == 2)
			{
				if (array2[0] == "chara")
				{
					charaName = array2[1];
				}
				else if (array2[0] == "next")
				{
					next = array2[1];
				}
			}
		}
	}

	// Token: 0x06000D34 RID: 3380 RVA: 0x0004FE18 File Offset: 0x0004E018
	private void Update()
	{
		this.sceneCanvas.enabled = (!this.config.isActiveAndEnabled && !this.gameCtrl.IsHideUI);
		this.pauseMenue.EnableConfig = !this.config.isActiveAndEnabled;
		this.editMode.ShowUI(!this.config.gameObject.activeSelf);
		this.UpdateShortCutKeys();
		if (this.headForcus > 0f)
		{
			this.headForcus -= Time.deltaTime;
			if (this.headForcus <= 0f)
			{
				this.camera.SetFocus(this.human.FacePos, true);
			}
		}
		GlobalData.poseChangeCameraFocus = this.poseCameraFocus.isOn;
	}

	// Token: 0x06000D35 RID: 3381 RVA: 0x0004FEE8 File Offset: 0x0004E0E8
	private void UpdateShortCutKeys()
	{
		if (EventSystem.current != null && EventSystem.current.currentSelectedGameObject != null)
		{
			return;
		}
		if (Input.GetKeyDown(KeyCode.R))
		{
			this.CameraReset();
		}
		else if (Input.GetKeyDown(KeyCode.Q))
		{
			this.camera.SetFocus(this.human.FacePos, true);
		}
		else if (Input.GetKeyDown(KeyCode.W))
		{
			string name = (this.human.sex != SEX.FEMALE) ? "cm_J_Spine03" : "cf_J_Spine03";
			Transform transform = Transform_Utility.FindTransform_Partial(this.human.body.AnimatedBoneRoot, name);
			if (transform != null)
			{
				this.camera.SetFocus(transform.position, true);
			}
		}
		else if (Input.GetKeyDown(KeyCode.E))
		{
			string name2 = (this.human.sex != SEX.FEMALE) ? "cm_J_Kokan" : "cf_J_Kokan";
			Transform transform2 = Transform_Utility.FindTransform_Partial(this.human.body.AnimatedBoneRoot, name2);
			if (transform2 != null)
			{
				this.camera.SetFocus(transform2.position, true);
			}
		}
	}

	// Token: 0x06000D36 RID: 3382 RVA: 0x00050024 File Offset: 0x0004E224
	private void CameraReset()
	{
		string name = (this.human.sex != SEX.FEMALE) ? "cm_J_Spine03" : "cf_J_Spine03";
		Transform transform = Transform_Utility.FindTransform_Partial(this.human.body.AnimatedBoneRoot, name);
		if (transform != null)
		{
			Vector3 facePos = this.human.FacePos;
			Vector3 b = transform.TransformPoint(new Vector3(0f, 0f, 0.08f));
			Vector3 focus = (facePos + b) * 0.5f;
			Vector3 rotate = new Vector3(10f, 0f, 0f);
			float num = 25f / ConfigData.defParse;
			this.camera.Set(focus, rotate, 1.5f * num, ConfigData.defParse);
		}
	}

	// Token: 0x06000D37 RID: 3383 RVA: 0x000500F0 File Offset: 0x0004E2F0
	private void SetupCreatedHuman()
	{
		this.equipShow.Setup(this.human);
		if (this.human.sex == SEX.FEMALE)
		{
			this.PoseSetupList(this.poseList_F);
			this.SetupList(this.eyeExpressionSets, this.eyeExpressionList_F, this.eyeExpressionDropdown);
			this.SetupList(this.mouthExpressionSets, this.mouthExpressionList_F, this.mouthExpressionDropdown);
		}
		else
		{
			this.PoseSetupList(this.poseList_M);
			this.SetupList(this.eyeExpressionSets, this.eyeExpressionList_M, this.eyeExpressionDropdown);
			this.SetupList(this.mouthExpressionSets, this.mouthExpressionList_M, this.mouthExpressionDropdown);
		}
		this.editMode.Setup(this.human, this);
		this.editMode.gameObject.SetActive(true);
	}

	// Token: 0x06000D38 RID: 3384 RVA: 0x000501C0 File Offset: 0x0004E3C0
	private void SetupList(List<AnimeAndNameSet> sets, TextAsset textAsset, Dropdown dropdown)
	{
		CustomDataListLoader customDataListLoader = new CustomDataListLoader();
		customDataListLoader.Load(textAsset);
		int attributeNo = customDataListLoader.GetAttributeNo("anime");
		int attributeNo2 = customDataListLoader.GetAttributeNo("name");
		List<Dropdown.OptionData> list = new List<Dropdown.OptionData>();
		for (int i = 0; i < customDataListLoader.GetDataNum(); i++)
		{
			string data = customDataListLoader.GetData(attributeNo, i);
			string data2 = customDataListLoader.GetData(attributeNo2, i);
			sets.Add(new AnimeAndNameSet(data, data2));
			list.Add(new Dropdown.OptionData(i.ToString("00:") + data2));
		}
		dropdown.ClearOptions();
		dropdown.options = list;
	}

	// Token: 0x06000D39 RID: 3385 RVA: 0x00050264 File Offset: 0x0004E464
	private void PoseSetupList(TextAsset textAsset)
	{
		CustomDataListLoader customDataListLoader = new CustomDataListLoader();
		customDataListLoader.Load(textAsset);
		int attributeNo = customDataListLoader.GetAttributeNo("anime");
		int attributeNo2 = customDataListLoader.GetAttributeNo("name");
		for (int i = 0; i < customDataListLoader.GetDataNum(); i++)
		{
			string data = customDataListLoader.GetData(attributeNo, i);
			string data2 = customDataListLoader.GetData(attributeNo2, i);
			if (data2.IndexOf("床") == 0)
			{
				this.poseSets_floor.Add(new AnimeAndNameSet(data, data2));
			}
			else if (data2.IndexOf("椅子") == 0)
			{
				this.poseSets_chair.Add(new AnimeAndNameSet(data, data2));
			}
			else
			{
				this.poseSets_stand.Add(new AnimeAndNameSet(data, data2));
			}
		}
		List<Dropdown.OptionData> list = new List<Dropdown.OptionData>();
		list.Add(new Dropdown.OptionData("立ち"));
		if (this.human.sex == SEX.FEMALE)
		{
			list.Add(new Dropdown.OptionData("床"));
			list.Add(new Dropdown.OptionData("椅子"));
		}
		this.poseTypeDropdown.ClearOptions();
		this.poseTypeDropdown.options = list;
		this.ChangePoseNoDropdown();
	}

	// Token: 0x06000D3A RID: 3386 RVA: 0x00050394 File Offset: 0x0004E594
	private void CreateFemale(HEROINE heroineID)
	{
		Female female = ResourceUtility.CreateInstance<Female>(this.path_FemaleBody, "Female");
		female.SetHeroineID(heroineID);
		this.human = female;
		this.human.transform.rotation = Quaternion.Euler(0f, 180f, 0f);
		female.GagShow = false;
		CustomParameter heroineCustomParam = GlobalData.PlayData.GetHeroineCustomParam(heroineID);
		this.human.Load(heroineCustomParam, true);
		this.SetupCreatedHuman();
		AssetBundleController assetBundleController = new AssetBundleController();
		assetBundleController.OpenFromFile(GlobalData.assetBundlePath, "pose");
		this.human.body.Anime.runtimeAnimatorController = assetBundleController.LoadAsset<RuntimeAnimatorController>("AC_Edit_F");
		assetBundleController.Close(false);
		foreach (GameObject gameObject in this.createButtons)
		{
			gameObject.SetActive(false);
		}
		Resources.UnloadUnusedAssets();
		female.ChangeShowGag(false);
		female.ShowMosaic(false);
		IllusionCamera illusionCamera = UnityEngine.Object.FindObjectOfType<IllusionCamera>();
		this.human.ChangeEyeLook(LookAtRotator.TYPE.TARGET, illusionCamera.transform, false);
		this.CameraReset();
		this.tearSlider.interactable = (this.human.sex == SEX.FEMALE);
		this.flushSlider.interactable = (this.human.sex == SEX.FEMALE);
		this.charaMoveUI.Setup(this.human.transform);
		this.charaMoveUI.SetDef(Vector3.zero, Quaternion.Euler(0f, 180f, 0f));
		female.ExpressionPlay(1, "Mouth_Def", 0f);
	}

	// Token: 0x06000D3B RID: 3387 RVA: 0x00050528 File Offset: 0x0004E728
	private void CreateMale(MALE_ID maleID)
	{
		Male male = ResourceUtility.CreateInstance<Male>(this.path_MaleBody, "Male");
		male.SetMaleID(maleID);
		this.human = male;
		this.human.transform.rotation = Quaternion.Euler(0f, 180f, 0f);
		CustomParameter maleCustomParam = GlobalData.PlayData.GetMaleCustomParam(maleID);
		this.human.Load(maleCustomParam, true);
		this.SetupCreatedHuman();
		AssetBundleController assetBundleController = new AssetBundleController();
		assetBundleController.OpenFromFile(GlobalData.assetBundlePath, "pose");
		this.human.body.Anime.runtimeAnimatorController = assetBundleController.LoadAsset<RuntimeAnimatorController>("AC_Edit_M");
		assetBundleController.Close(false);
		foreach (GameObject gameObject in this.createButtons)
		{
			gameObject.SetActive(false);
		}
		Resources.UnloadUnusedAssets();
		male.SetShowTinWithWear(false);
		IllusionCamera illusionCamera = UnityEngine.Object.FindObjectOfType<IllusionCamera>();
		this.human.ChangeEyeLook(LookAtRotator.TYPE.TARGET, illusionCamera.transform, false);
		this.CameraReset();
		this.tearSlider.interactable = (this.human.sex == SEX.FEMALE);
		this.flushSlider.interactable = (this.human.sex == SEX.FEMALE);
		this.charaMoveUI.Setup(this.human.transform);
		this.charaMoveUI.SetDef(Vector3.zero, Quaternion.Euler(0f, 180f, 0f));
	}

	// Token: 0x06000D3C RID: 3388 RVA: 0x000506A0 File Offset: 0x0004E8A0
	public void Button_CreateFemale(int no)
	{
		this.CreateFemale((HEROINE)no);
	}

	// Token: 0x06000D3D RID: 3389 RVA: 0x000506AC File Offset: 0x0004E8AC
	public void Button_CreateMale(int no)
	{
		this.CreateMale((MALE_ID)no);
	}

	// Token: 0x06000D3E RID: 3390 RVA: 0x000506B8 File Offset: 0x0004E8B8
	private void OnChangePoseType(int id)
	{
		this.ChangePoseNoDropdown();
		this.poseNoDropdown.value = 0;
		List<AnimeAndNameSet> poseSet = this.GetPoseSet(this.poseTypeDropdown.value);
		this.human.body.Anime.CrossFadeInFixedTime(poseSet[0].anime, 0.1f);
	}

	// Token: 0x06000D3F RID: 3391 RVA: 0x00050710 File Offset: 0x0004E910
	private void OnChangePoseNo(int id)
	{
		List<AnimeAndNameSet> poseSet = this.GetPoseSet(this.poseTypeDropdown.value);
		this.human.body.Anime.CrossFadeInFixedTime(poseSet[id].anime, 0.1f);
		if (this.poseCameraFocus.isOn)
		{
			this.headForcus = 0.1f;
		}
	}

	// Token: 0x06000D40 RID: 3392 RVA: 0x00050770 File Offset: 0x0004E970
	private List<AnimeAndNameSet> GetPoseSet(int no)
	{
		if (no == 0)
		{
			return this.poseSets_stand;
		}
		if (no == 1)
		{
			return this.poseSets_floor;
		}
		if (no == 2)
		{
			return this.poseSets_chair;
		}
		return this.poseSets_stand;
	}

	// Token: 0x06000D41 RID: 3393 RVA: 0x000507A4 File Offset: 0x0004E9A4
	private void ChangePoseNoDropdown()
	{
		List<AnimeAndNameSet> poseSet = this.GetPoseSet(this.poseTypeDropdown.value);
		List<Dropdown.OptionData> list = new List<Dropdown.OptionData>();
		for (int i = 0; i < poseSet.Count; i++)
		{
			list.Add(new Dropdown.OptionData(i.ToString("00")));
		}
		this.poseNoDropdown.ClearOptions();
		this.poseNoDropdown.AddOptions(list);
	}

	// Token: 0x06000D42 RID: 3394 RVA: 0x00050810 File Offset: 0x0004EA10
	private void OnChangeEyeExpression(int id)
	{
		this.human.ExpressionPlay(0, this.eyeExpressionSets[id].anime, 0.1f);
	}

	// Token: 0x06000D43 RID: 3395 RVA: 0x00050834 File Offset: 0x0004EA34
	private void OnChangeMouthExpression(int id)
	{
		this.human.ExpressionPlay(1, this.mouthExpressionSets[id].anime, 0.1f);
	}

	// Token: 0x06000D44 RID: 3396 RVA: 0x00050858 File Offset: 0x0004EA58
	public void MovePose(int move)
	{
		this.DropdownMove(this.poseNoDropdown, move);
	}

	// Token: 0x06000D45 RID: 3397 RVA: 0x00050868 File Offset: 0x0004EA68
	public void MoveEyeExpression(int move)
	{
		this.DropdownMove(this.eyeExpressionDropdown, move);
	}

	// Token: 0x06000D46 RID: 3398 RVA: 0x00050878 File Offset: 0x0004EA78
	public void MoveMouthExpression(int move)
	{
		this.DropdownMove(this.mouthExpressionDropdown, move);
	}

	// Token: 0x06000D47 RID: 3399 RVA: 0x00050888 File Offset: 0x0004EA88
	private void DropdownMove(Dropdown dropdown, int move)
	{
		dropdown.value = (dropdown.options.Count + dropdown.value + move) % dropdown.options.Count;
	}

	// Token: 0x06000D48 RID: 3400 RVA: 0x000508B0 File Offset: 0x0004EAB0
	public void ExpressionPreset(int no)
	{
		string[] array = new string[]
		{
			"無表情",
			"喜び",
			"不機嫌",
			"怒り",
			"悲しい",
			"痛がり",
			"恥ずかし",
			"感じ"
		};
		string[] array2 = new string[]
		{
			"無表情",
			"喜び",
			"不機嫌",
			"怒り",
			"悲しい",
			"痛がり",
			"困り",
			"無表情"
		};
		string[] array3 = new string[]
		{
			"無表情",
			"笑顔",
			"怒り",
			"怒り",
			"悲しみ",
			"痛がり",
			"笑顔",
			"スケベ顔"
		};
		string[] array4 = new string[]
		{
			"無表情",
			"笑顔１",
			"無表情",
			"怒り",
			"悲しみ",
			"痛がり",
			"ニヤリ左",
			"スケベ顔"
		};
		int value = 0;
		int value2 = 0;
		for (int i = 0; i < this.eyeExpressionSets.Count; i++)
		{
			string b = (this.human.sex != SEX.FEMALE) ? array3[no] : array[no];
			if (this.eyeExpressionSets[i].name == b)
			{
				value = i;
				break;
			}
		}
		for (int j = 0; j < this.mouthExpressionSets.Count; j++)
		{
			string b2 = (this.human.sex != SEX.FEMALE) ? array4[no] : array2[no];
			if (this.mouthExpressionSets[j].name == b2)
			{
				value2 = j;
				break;
			}
		}
		this.eyeExpressionDropdown.value = value;
		this.mouthExpressionDropdown.value = value2;
	}

	// Token: 0x06000D49 RID: 3401 RVA: 0x00050AC4 File Offset: 0x0004ECC4
	public void OnChangeEyeOpen(float val)
	{
		this.human.OpenEye(val);
	}

	// Token: 0x06000D4A RID: 3402 RVA: 0x00050AD4 File Offset: 0x0004ECD4
	public void OnChangeMouthOpen(float val)
	{
		this.human.OpenMouth(val);
	}

	// Token: 0x06000D4B RID: 3403 RVA: 0x00050AE4 File Offset: 0x0004ECE4
	public void OnChangeFlush(float val)
	{
		this.human.SetFlush(val, true);
	}

	// Token: 0x06000D4C RID: 3404 RVA: 0x00050AF4 File Offset: 0x0004ECF4
	public void OnChangeTear(float val)
	{
		this.human.SetTear(val, true);
	}

	// Token: 0x06000D4D RID: 3405 RVA: 0x00050B04 File Offset: 0x0004ED04
	public void OnChangeEye(int no)
	{
		IllusionCamera illusionCamera = UnityEngine.Object.FindObjectOfType<IllusionCamera>();
		if (no == 0)
		{
			this.human.ChangeEyeLook(LookAtRotator.TYPE.FORWARD, null, false);
		}
		else if (no == 1)
		{
			this.human.ChangeEyeLook(LookAtRotator.TYPE.TARGET, illusionCamera.transform, false);
		}
		else if (no == 2)
		{
			this.human.ChangeEyeLook(LookAtRotator.TYPE.HOLD, null, false);
		}
	}

	// Token: 0x06000D4E RID: 3406 RVA: 0x00050B64 File Offset: 0x0004ED64
	public void OnChangeNeck(int no)
	{
		IllusionCamera illusionCamera = UnityEngine.Object.FindObjectOfType<IllusionCamera>();
		if (no == 0)
		{
			this.human.ChangeNeckLook(LookAtRotator.TYPE.NO, null, false);
		}
		else if (no == 1)
		{
			this.human.ChangeNeckLook(LookAtRotator.TYPE.TARGET, illusionCamera.transform, false);
		}
		else if (no == 2)
		{
			this.human.ChangeNeckLook(LookAtRotator.TYPE.HOLD, null, false);
		}
	}

	// Token: 0x06000D4F RID: 3407 RVA: 0x00050BC4 File Offset: 0x0004EDC4
	public void OpenConfig()
	{
		this.config.gameObject.SetActive(true);
		this.gameCtrl.audioCtrl.Play2DSE(this.gameCtrl.audioCtrl.systemSE_open);
	}

	// Token: 0x06000D50 RID: 3408 RVA: 0x00050BF8 File Offset: 0x0004EDF8
	public void Button_Back()
	{
		this.gameCtrl.audioCtrl.Play2DSE(this.gameCtrl.audioCtrl.systemSE_choice);
		if (this.nextScene == "GameStart")
		{
			this.SaveCaution("ゲームを開始する", new Action<bool>(this.ToGameStart));
		}
		else
		{
			this.SaveCaution("選択画面へ戻る", new Action<bool>(this.ToSelect));
		}
	}

	// Token: 0x06000D51 RID: 3409 RVA: 0x00050C70 File Offset: 0x0004EE70
	private void Button_Title()
	{
		this.gameCtrl.audioCtrl.Play2DSE(this.gameCtrl.audioCtrl.systemSE_choice);
		string text = "タイトルに戻ります。\nセーブしていない場合は\nゲームの進行状況、キャラカスタム等は失われます。\nよろしいですか？";
		this.gameCtrl.CreateModalYesNoUI(text, new Action(this.ToTitle), null);
	}

	// Token: 0x06000D52 RID: 3410 RVA: 0x00050CBC File Offset: 0x0004EEBC
	private void ToTitle()
	{
		this.gameCtrl.ChangeScene("TitleScene", string.Empty, 0.5f);
	}

	// Token: 0x06000D53 RID: 3411 RVA: 0x00050CD8 File Offset: 0x0004EED8
	private void ToSelect(bool record)
	{
		if (record)
		{
			this.RecordCustomData();
		}
		this.gameCtrl.ChangeScene("SelectScene", string.Empty, 0.5f);
	}

	// Token: 0x06000D54 RID: 3412 RVA: 0x00050D00 File Offset: 0x0004EF00
	public void OnExit()
	{
		this.gameCtrl.audioCtrl.Play2DSE(this.gameCtrl.audioCtrl.systemSE_choice);
		string text = "ゲームを終了します。\nセーブしていない場合は\nゲームの進行状況、キャラカスタム等は失われます。\nよろしいですか？";
		this.gameCtrl.CreateModalYesNoUI(text, new Action(this.ToExit), null);
	}

	// Token: 0x06000D55 RID: 3413 RVA: 0x00050D4C File Offset: 0x0004EF4C
	private void ToExit()
	{
		this.gameCtrl.ChangeScene("ExitScene", string.Empty, 1f);
	}

	// Token: 0x06000D56 RID: 3414 RVA: 0x00050D68 File Offset: 0x0004EF68
	public void Button_GameStart()
	{
		this.gameCtrl.audioCtrl.Play2DSE(this.gameCtrl.audioCtrl.systemSE_choice);
		this.SaveCaution("ゲームを開始する", new Action<bool>(this.ToGameStart));
	}

	// Token: 0x06000D57 RID: 3415 RVA: 0x00050DA4 File Offset: 0x0004EFA4
	private void ToGameStart(bool record)
	{
		if (record)
		{
			this.RecordCustomData();
		}
		base.GC.ChangeScene("ADVScene", "adv/adv_00_00,ADV_Script_00_00", 1f);
	}

	// Token: 0x06000D58 RID: 3416 RVA: 0x00050DCC File Offset: 0x0004EFCC
	public void Button_DemoMovie()
	{
	}

	// Token: 0x06000D59 RID: 3417 RVA: 0x00050DD0 File Offset: 0x0004EFD0
	private void RecordCustomData()
	{
		CustomParameter customParameter;
		if (this.human.sex == SEX.FEMALE)
		{
			Female female = this.human as Female;
			customParameter = GlobalData.PlayData.GetHeroineCustomParam(female.HeroineID);
		}
		else
		{
			Male male = this.human as Male;
			customParameter = GlobalData.PlayData.GetMaleCustomParam(male.MaleID);
		}
		if (customParameter != null)
		{
			customParameter.Copy(this.human.customParam, -1);
		}
	}

	// Token: 0x06000D5A RID: 3418 RVA: 0x00050E48 File Offset: 0x0004F048
	private void Button_Custom_M(int no)
	{
		this.gameCtrl.audioCtrl.Play2DSE(this.gameCtrl.audioCtrl.systemSE_choice);
		string nextName = Male.MaleName((MALE_ID)no) + "のカスタムへ切り替える";
		this.SaveCaution(nextName, delegate(bool b)
		{
			this.ToCustom_M(b, no);
		});
	}

	// Token: 0x06000D5B RID: 3419 RVA: 0x00050EB4 File Offset: 0x0004F0B4
	private void ToCustom_M(bool record, int no)
	{
		if (record)
		{
			this.RecordCustomData();
		}
		string charaName = Male.MaleName((MALE_ID)no);
		string msg = EditScene.CreateMessage(charaName, this.nextScene);
		base.GC.ChangeScene("EditScene", msg, 1f);
	}

	// Token: 0x06000D5C RID: 3420 RVA: 0x00050EF8 File Offset: 0x0004F0F8
	private void Button_Custom_F(int no)
	{
		this.gameCtrl.audioCtrl.Play2DSE(this.gameCtrl.audioCtrl.systemSE_choice);
		string nextName = Female.HeroineName((HEROINE)no) + "のカスタムへ切り替える";
		this.SaveCaution(nextName, delegate(bool b)
		{
			this.ToCustom_F(b, no);
		});
	}

	// Token: 0x06000D5D RID: 3421 RVA: 0x00050F64 File Offset: 0x0004F164
	private void ToCustom_F(bool record, int no)
	{
		if (record)
		{
			this.RecordCustomData();
		}
		string charaName = Female.HeroineName((HEROINE)no);
		string msg = EditScene.CreateMessage(charaName, this.nextScene);
		base.GC.ChangeScene("EditScene", msg, 1f);
	}

	// Token: 0x06000D5E RID: 3422 RVA: 0x00050FA8 File Offset: 0x0004F1A8
	private void SaveCaution(string nextName, Action<bool> next)
	{
		string[] choices = new string[]
		{
			"適用する",
			"適用しない",
			"カスタムに戻る"
		};
		Action[] array = new Action[3];
		array[0] = delegate()
		{
			next(true);
		};
		array[1] = delegate()
		{
			next(false);
		};
		Action[] acts = array;
		string text = string.Empty;
		text = text + nextName + "前に、";
		text = text + this.NowCharaName() + "の変更を適用しますか？\n";
		text += "(ゲームで使用する場合は変更を適用する必要があります。\n";
		text += "適用しない場合、カスタム画面が開かれる前の状態に戻り\n";
		text += "現在のキャラはカードとして保存していない場合は失われます)";
		this.gameCtrl.CreateModalChoices(text, choices, acts);
	}

	// Token: 0x06000D5F RID: 3423 RVA: 0x00051060 File Offset: 0x0004F260
	private string NowCharaName()
	{
		if (this.human.sex == SEX.FEMALE)
		{
			Female female = this.human as Female;
			return Female.HeroineName(female.HeroineID);
		}
		if (this.human.sex == SEX.MALE)
		{
			Male male = this.human as Male;
			return Male.MaleName(male.MaleID);
		}
		return "- UNKNOWN -";
	}

	// Token: 0x04000DAC RID: 3500
	public string path_FemaleBody = "FemaleBody";

	// Token: 0x04000DAD RID: 3501
	public string path_MaleBody = "MaleBody";

	// Token: 0x04000DAE RID: 3502
	[SerializeField]
	private GameObject[] createButtons;

	// Token: 0x04000DAF RID: 3503
	[SerializeField]
	private EditMode editMode;

	// Token: 0x04000DB0 RID: 3504
	[SerializeField]
	private Canvas sceneCanvas;

	// Token: 0x04000DB1 RID: 3505
	public EditEquipShow equipShow;

	// Token: 0x04000DB2 RID: 3506
	private Human human;

	// Token: 0x04000DB3 RID: 3507
	[SerializeField]
	private TextAsset poseList_F;

	// Token: 0x04000DB4 RID: 3508
	[SerializeField]
	private TextAsset poseList_M;

	// Token: 0x04000DB5 RID: 3509
	[SerializeField]
	private TextAsset mouthExpressionList_F;

	// Token: 0x04000DB6 RID: 3510
	[SerializeField]
	private TextAsset mouthExpressionList_M;

	// Token: 0x04000DB7 RID: 3511
	[SerializeField]
	private TextAsset eyeExpressionList_F;

	// Token: 0x04000DB8 RID: 3512
	[SerializeField]
	private TextAsset eyeExpressionList_M;

	// Token: 0x04000DB9 RID: 3513
	[SerializeField]
	private Dropdown poseTypeDropdown;

	// Token: 0x04000DBA RID: 3514
	[SerializeField]
	private Dropdown poseNoDropdown;

	// Token: 0x04000DBB RID: 3515
	[SerializeField]
	private Toggle poseCameraFocus;

	// Token: 0x04000DBC RID: 3516
	private List<AnimeAndNameSet> poseSets_stand = new List<AnimeAndNameSet>();

	// Token: 0x04000DBD RID: 3517
	private List<AnimeAndNameSet> poseSets_floor = new List<AnimeAndNameSet>();

	// Token: 0x04000DBE RID: 3518
	private List<AnimeAndNameSet> poseSets_chair = new List<AnimeAndNameSet>();

	// Token: 0x04000DBF RID: 3519
	[SerializeField]
	private Dropdown eyeExpressionDropdown;

	// Token: 0x04000DC0 RID: 3520
	[SerializeField]
	private Dropdown mouthExpressionDropdown;

	// Token: 0x04000DC1 RID: 3521
	[SerializeField]
	private Slider tearSlider;

	// Token: 0x04000DC2 RID: 3522
	[SerializeField]
	private Slider flushSlider;

	// Token: 0x04000DC3 RID: 3523
	private List<AnimeAndNameSet> eyeExpressionSets = new List<AnimeAndNameSet>();

	// Token: 0x04000DC4 RID: 3524
	private List<AnimeAndNameSet> mouthExpressionSets = new List<AnimeAndNameSet>();

	// Token: 0x04000DC5 RID: 3525
	[SerializeField]
	private Config configOriginal;

	// Token: 0x04000DC6 RID: 3526
	private Config config;

	// Token: 0x04000DC7 RID: 3527
	[SerializeField]
	private PauseMenue pauseMenueOriginal;

	// Token: 0x04000DC8 RID: 3528
	private PauseMenue pauseMenue;

	// Token: 0x04000DC9 RID: 3529
	[SerializeField]
	private LightController light;

	// Token: 0x04000DCA RID: 3530
	[SerializeField]
	private Button[] toCustomMs;

	// Token: 0x04000DCB RID: 3531
	[SerializeField]
	private Button[] toCustomFs;

	// Token: 0x04000DCC RID: 3532
	[SerializeField]
	private Button toReturn;

	// Token: 0x04000DCD RID: 3533
	[SerializeField]
	private CharaMoveController charaMoveUI;

	// Token: 0x04000DCE RID: 3534
	[SerializeField]
	private Transform _showTransform;

	// Token: 0x04000DCF RID: 3535
	[SerializeField]
	private float[] _showVerticalPosition = new float[2];

	// Token: 0x04000DD0 RID: 3536
	private IllusionCamera camera;

	// Token: 0x04000DD1 RID: 3537
	private string bgm = "Select";

	// Token: 0x04000DD2 RID: 3538
	private float headForcus = -1f;

	// Token: 0x04000DD3 RID: 3539
	private string nextScene = string.Empty;
}
